/*
 * 常见问题与流程切换攻略
 */
var content = document.getElementById('strategy-banner');
var part = document.getElementById('part');
var strategy = document.getElementById('flow');
var problem = document.getElementById('problem');

strategy.onclick = function(){
	content.style.display = 'none';
	part.style.display = 'block';
	strategy.style.color = 'white';
	strategy.style.background = "#00B38A";
	problem.style.background = 'white';
	problem.style.color = '#00B38A';
	problem.style.border = '1px solid #00B38A'
}

problem.onclick = function(){
	content.style.display = 'block';
	part.style.display = 'none';
	problem.style.color = 'white';
	problem.style.background = "#00B38A";
	strategy.style.background = 'white';
	strategy.style.color = '#00B38A';
	strategy.style.border = '1px solid #00B38A'
}
	

/*
* 二级菜单
*/
var banner = document.getElementsByClassName('banner');
var bannerHidden  =document.getElementsByClassName('banner-hidden');
var bannerTip = document.getElementsByClassName('banner-tip');
var up = document.getElementsByClassName('up');

for(var i = 0; i < banner.length;i++){
	banner[i].onclick = function(index){
		return function(){
			if(bannerHidden[index].style.height == "90px"){
				bannerHidden[index].style.height = "0px";
				banner[index].style.borderBottom = '1px dashed #E2E2E2';
				bannerTip[index].style.display = 'block';
				up[index].style.display = 'none';
			}else{
				banner[index].style.background = '#FAFAFA';
				banner[index].style.borderBottom = 'none';
				bannerTip[index].style.display = 'none';
				up[index].style.display = 'block';
				bannerHidden[index].style.height = "90px";
				bannerHidden[index].style.transition = 'height 1s';
			}	
		}
	}(i)
}